<template>
	<div>
		News组件

		<br />
		<ul>
			<li v-for="(item, index) in list" :key="index">
				<router-link :to="`/newscontent/${index}`"> {{item}}</router-link>
			</li>
		</ul>
	</div>
</template>

<script lang="ts">
	import { defineComponent } from "vue";
	//data数据的接口
	interface News {
		list : string[];
	}
	export default defineComponent({
		data() {
			return {
				list: []
			} as News;
		},
		mounted() {
			for (let i = 0; i < 10; i++) {
				this.list.push(`我是第${i}个新闻`);
			}
		},
	});
</script>

<style lang="scss">
	//cnpm install -D sass-loader node-sass
</style>